package com.mx.pojo.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.mx.pojo.Article;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author MinXu
 * @since 2021/7/28
 * QQ   754647431
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ArticleVO {
    private static final long serialVersionUID = 1L;

    public ArticleVO(UserVO user, Article article) {
        this.id=article.getId();
        this.user = user;
        this.title=article.getTitle();
        this.content=article.getContent();
        this.createDate=article.getCreateDate();
        this.modifyDate=article.getModifyDate();
        this.image=article.getImage();
        this.star=article.getStar();
        this.agree=article.getAgree();
        this.view=article.getView();
        this.ispublic=article.getIspublic();
    }

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private UserVO user;

    /**
     * 文章标题
     */
    private String title;

    private String content;

    private Date createDate;

    private Date modifyDate;

    /**
     * 文章封面
     */
    private String image;

    private Integer agree;

    private Integer star;

    private Integer view;

    private Boolean ispublic;
}
